<?php
namespace app\erp\validate;
use think\Validate;
class Articlerule extends Validate{
    protected $rule = [
        'article_name' => 'require|unique:article,article_name^partner_id',
        'sort'=> 'require|number'
    ];

    protected $message = [
        'article_name.require' => '文章标题必须填写',
        'article_name.unique' => '文章标题已存在',
        'sort.require' => '排序不能为空',
        'sort.number' => '排序只能是数字'
    ];
    protected $scene = [
        'edit' => [
            'article_name' => 'unique:article,article_name^partner_id',
            'sort' => 'number'
        ]
    ];
}